home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / 3DGPL 1.0 / CODE / HARDWARE / Macintosh / HARDWARE.H < prev   
Encoding:
C/C++ Source or Header  |  1997-03-08  |  2.6 KB  |  76 lines  |  [TEXT/CWIE]

  1. #ifndef _HARDWARE_H_
  2. #define _HARDWARE_H_
  3.  
  4. /** 3DGPL *************************************************\
  5.  *  (Macintosh, 8bit deep bitmaps, 32bit mashine)          *     
  6.  *  Header for hardware specific stuff.                   *
  7.  *                                                        *
  8.  *  hardware.c               hardware specific stuff.     *
  9.  *                                                        *
  10.  *  (6/1995) By Sergei Savhenko. (savs@cs.mcgill.ca).     *
  11.  *  Copyright (c) 1995 Sergei Savchenko.                  *
  12.  *  THIS SOURCE CODE CAN'T BE USED FOR COMERCIAL PURPOSES *
  13.  *  WITHOUT AUTHORISATION                                 *
  14. \**********************************************************/
  15. // Hacked for Mac by Ingemar
  16.  
  17. #include <string.h>                         /* memset etc. */
  18.  
  19. typedef short signed_16_bit;
  20. typedef int   signed_32_bit;                /* compiler/mashine dependent */
  21. typedef unsigned short unsigned_16_bit;
  22. typedef unsigned int   unsigned_32_bit;
  23.  
  24. void HW_set_int(int *dst,long lng,int val);
  25. #define HW_set_char(dst,lng,val)  memset(dst,val,lng)
  26. #define HW_copy_int(src,dst,lng)  memcpy(dst,src,lng*sizeof(int))
  27. #define HW_copy_char(src,dst,lng) memcpy(dst,src,lng)
  28.  
  29. #define HW_SCREEN_X_SIZE            320             
  30. #define HW_SCREEN_Y_SIZE            200     /* number of pixels total */
  31.  
  32. #define HW_SCREEN_X_MAX             319
  33. #define HW_SCREEN_Y_MAX             199     /* number of maximum pixel */
  34.  
  35. #define HW_SCREEN_X_CENTRE          160     
  36. #define HW_SCREEN_Y_CENTRE          100     /* middle of the screen */
  37.  
  38. #define HW_COLOURMAP_SIZE_CHAR    64000     /* bytes in the colourmap */
  39. #define HW_COLOURMAP_SIZE_INT     16000     /* ints in the colourmap */
  40.  
  41. struct HW_colour                            /* describes colour */
  42. {
  43.  int hw_r;
  44.  int hw_g;
  45.  int hw_b;                                  /* intensity components */
  46. };
  47.  
  48. int HW_open_screen(char *display_name,
  49.                    char *screen_name, 
  50.                    struct HW_colour palette[256],
  51.                    unsigned char *colourmap
  52.                   );
  53. void HW_blit(void);
  54. void HW_close_screen(void);
  55.  
  56. #define HW_KEY_ARROW_LEFT  0x1C
  57. #define HW_KEY_ARROW_RIGHT 0x1D
  58. #define HW_KEY_ARROW_UP    0x1E
  59. #define HW_KEY_ARROW_DOWN  0x1F
  60.  
  61. #define HW_KEY_PLUS         43
  62. #define HW_KEY_MINUS        45
  63.  
  64. #define HW_KEY_ENTER        13
  65. #define HW_KEY_SPACE        32
  66. #define HW_KEY_TAB           9              /* all i can think of */ 
  67.  
  68. void HW_run_event_loop(void (*application_main)(void),
  69.                        void (*application_key_handler)(int key_code)
  70.                       );
  71. void HW_quit_event_loop(void);
  72.  
  73. /**********************************************************/
  74.  
  75. #endif
  76.